import Vue from 'vue'
import Vuex from 'vuex'
import createPersistedState from 'vuex-persistedstate'

Vue.use(Vuex);

const store = new Vuex.Store({
  plugins:[createPersistedState()],
  state:{
    userInfo:{}, //用户数据
    havNewTask:'',//设置任务列表是否需要更新
    setMilePostSave:'',//里程碑是否保存了
    countUnRead:'',//消息未读数量
    unCompleteDelayNum:'',//任务延期申请数量
  },
  modules:{

  },
  mutations:{
    //
    SET_USERINFO_UNCCOMPLETEDELAYNUM(state,data){
      state.unCompleteDelayNum = data;
    },
    //设置用户数据
    SET_USERINFO(state,data){
      state.userInfo = data;
    },
    //设置当前导航
    SET_NAV_ACTIVE(state,data){
      state.navActive = data;
    },
    //设置用户头像
    SET_USERINFO_HEAD(state,data){
      state.userInfo.headImage = data;
    },
    //设置任务列表是否需要更新
    SET_HAVNEWTASK(state,data){
      state.havNewTask=data;
    },
    SET_MILEPOST_SAVE(state,data){
      state.setMilePostSave=data;
    },
    //设置
    SET_COUNT_UNREAD(state,data){
      state.countUnRead=data;
    },
  },
  getters:{

  },

});
export default store
